import request from '@/router/axios'
import moment from 'moment';
import {fenExYuangettoFixed, numToTwoPoint} from "../../../subwayRat/commonCheck";
export function getXw_hlw_shouJieSuan_waitSubmit(query) {
  return request({
    url: '/check/xw_js_hlw/getXw_hlw_shouJieSuan_waitSubmit',
    method: 'post',
    params: query
  })
}

export function hlwSubmitData(query) {
  return request({
    url: '/check/xw_js_hlw/hlwSubmitData',
    method: 'post',
    params: query
  })
}


export function getXw_hlw_shouJieSuan_preview(query) {
  return request({
    url: '/check/xw_js_hlw/getXw_hlw_shouJieSuan_preview',
    method: 'post',
    params: query
  })
}

export function waitSubmitMainOptionList(){
  return {
    emptyBtn:false,
    editBtn:false,
    delBtn:false,
    addBtn:false,
    refreshBtn:false,
    columnBtn:false,
    border: true,
    index:true,
    indexLabel:'序号',
    page:false,
    align:'center',
    menuWidth:150,
    menuAlign:'center',
    selection: true,
    reserveSelection:false,
    height: 450,
    column:[
      {prop:"startTime", label:"开始时间",type:'date',valueFormat:"yyyy-MM-dd"},
      {prop:"endTime", label:"结束时间",type:'date',valueFormat:"yyyy-MM-dd"},
      {prop:"equipmentCode", label:"设备编号",type:'select',search:true,filterable: true,
        dicUrl: "/support/swpminternetticketequipmentcode/page",
        props: {
          label: "equipmentCode",
          value: "equipmentCode",
          res: "data.records"
        },
      },
      {prop:"revenueDate", label:"收益日期",type:'date',search:true,valueFormat:"yyyy-MM-dd"},
      {prop:"saleNumber", label:"发售数量(合计)"},
      {prop:"totalSaleAmount", label:"小计金额(合计)",formatter:function (row,v) {
          if(v){
            return Number(v).toFixed(2);
          }
          return v;
        }},
      {prop:"remark", label:"备注"},
    ]
  }
}



export function aready_Hlw_SubmitMainOptionList(){
  return {
    emptyBtn:false,
    editBtn:false,
    delBtn:false,
    addBtn:false,
    refreshBtn:false,
    columnBtn:false,
    border: true,
    index:true,
    indexLabel:'序号',
    page:false,
    align:'center',
    menuWidth:150,
    menuAlign:'center',
    selection: true,
    reserveSelection:false,
    height: 450,
    column:[
      {prop:"startTime", label:"开始时间",type:'date',width: 90},
      {prop:"endTime", label:"结束时间",type:'date',width: 90},
      {prop:"equipmentCode", label:"设备编号",type:'select',search:true,filterable: true,
        dicUrl: "/support/swpminternetticketequipmentcode/page",
        props: {
          label: "equipmentCode",
          value: "equipmentCode",
          res: "data.records"
        },
      },
      {prop:"revenueDate", label:"收益日期",type:'date',search:true,valueFormat:"yyyy-MM-dd",width: 90},
      {prop:"saleNumber", label:"发售数量(合计)",width: 120},
      {prop:"totalSaleAmount", label:"小计金额(合计)",width: 120,formatter:function (row,v) {
          if(v){
            return Number(v).toFixed(2);
          }
          return v;
        }},
      {prop:"remark", label:"备注"},
      {prop:"passengerAttendantName", label:"录入人",width: 85},
      {prop:"passengerAttendantJobNo", label:"录入人员工号",width: 110},
      {prop:"attendancePersonName", label:"复核人"},
      {prop:"attendancePersonJobNo", label:"复核人员工号",width: 100},
    ]
  }
}




export function hlwpreviewOption(){
  return {
    emptyBtn:false,
    editBtn:false,
    delBtn:false,
    addBtn:false,
    refreshBtn:false,
    columnBtn:false,
    border: true,
    index:true,
    indexLabel:'序号',
    page:false,
    align:'center',
    menu:false,
    menuWidth:150,
    menuAlign:'center',
    selection: false,
    reserveSelection:false,
    column:[
      {prop:"equipmentCode", label:"设备编号"},
      {prop:"unitPrice", label:"单价"},
      {prop:"saleNumber", label:"发售张数"},
      {prop:"totalSaleAmount", label:"小计金额",formatter:function (row,v) {
        return numToTwoPoint(row.saleNumber*row.unitPrice);
        }},
    ]
  }
}
